﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sharp.Domain.Model;

namespace Sharp.Domain.PlatformBoundedContext.PlatformModule.Aggregates
{
    /// <summary>
    /// 平台下级系统
    /// </summary>
    public class SubSystem : IAggregateRoot
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Required]
        public string Name { get; set; }
        /// <summary>
        /// 代号
        /// </summary>
        [Required]
        public string Code { get; set; }

        /// <summary>
        /// 服务地址
        /// </summary>
        [StringLength(255)]
        public string ServUrl { get; set; }
        /// <summary>
        /// 用于OAuth的ClientID
        /// </summary>
        public string ClientId { get; set; }
        /// <summary>
        /// 用于OAuth的ClientSecret
        /// </summary>
        public string ClientSecret { get; set; }

        public string ClientRedirectUri { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(255)]
        public string Remark { get; set; }

        /// <summary>
        /// json格式的配置信息
        /// </summary>
        [MaxLength]
        public string Config { get; set; }
        /// <summary>
        /// 排序字段
        /// </summary>
        /// <remarks>越小越靠前</remarks>
        public int OrderIndex { get; set; }
    }
}
